<%= form_for [:shop, @order_item], html: { class: "card" } do |f| %>
  <div class="row row-cards row-deck">
    <div class="col-12">
      <div class="card-body">
        <h5>退款详情及关联订单信息</h5>
        <div class="row">
          <div class="col-md-4">
            <div class="form-group">
              <label class="form-label">订单编号</label>
              <div class="form-control-plaintext"><%= @order_item.order.trade_no %></div>
            </div>
          </div>
          <div class="col-md-4">
            <div class="form-group">
              <label class="form-label">下单时间</label>
              <div class="form-control-plaintext"><%= formattime(@order_item.order.created_at, unit: "hour") %></div>
            </div>
          </div>
          <div class="col-md-4">
            <div class="form-group">
              <label class="form-label">付款方式</label>
              <div class="form-control-plaintext"><%= i18n_enum @order_item.order, :pay_method %></div>
            </div>
          </div>
          <div class="col-md-4">
            <div class="form-group">
              <label class="form-label">状态</label>
              <div class="form-control-plaintext"><%= i18n_enum @order_item.order, :state %></div>
            </div>
          </div>
        </div>
        <div class="line"></div>
        <h5>用户信息</h5>
        <div class="row">
          <div class="col-md-4">
            <div class="form-group">
              <label class="form-label">下单用户姓名</label>
              <div class="form-control-plaintext"><%= @order_item.order.user.nickname %></div>
            </div>
          </div>
          <div class="col-md-4">
            <div class="form-group">
              <label class="form-label">下单用户账号</label>
              <div class="form-control-plaintext"><%= @order_item.order.user.phone %></div>
            </div>
          </div>
        </div>
        <div class="line"></div>
        <h5>物流信息</h5>
        <div class="row">
          <div class="col-md-4">
            <div class="form-group">
              <label class="form-label">收货姓名</label>
              <div class="form-control-plaintext"><%= @order_item.order.buyer_name %></div>
            </div>
          </div>
          <div class="col-md-4">
            <div class="form-group">
              <label class="form-label">收货手机</label>
              <div class="form-control-plaintext"><%= @order_item.order.buyer_phone %></div>
            </div>
          </div>
          <div class="col-md-12">
            <div class="form-group">
              <label class="form-label">快递方式</label>
              <div class="form-control-plaintext"><%= @order_item.order.address %></div>
            </div>
          </div>
          <div class="col-md-4">
            <div class="form-group">
              <label class="form-label">快递方式</label>
              <div class="form-control-plaintext"><%= @order_item.order.need_express ? "快递" : "自提" %></div>
            </div>
          </div>
          <div class="col-md-4">
            <div class="form-group">
              <label class="form-label">快递公司</label>
              <div class="form-control-plaintext"><%= @order_item.order.logistics_company.blank? ? "" : @order_item.order.logistics_company.name %></div>
            </div>
          </div>
          <div class="col-md-4">
            <div class="form-group">
              <label class="form-label">快递单号</label>
              <div class="form-control-plaintext"><%= @order_item.order.logistics_trade_no %></div>
            </div>
          </div>
        </div>
        <div class="line"></div>
        <h5>商品信息</h5>
        <table class="table table-hover table-outline table-vcenter text-nowrap card-table">
          <thead>
            <tr>
              <th>商品</th>
              <th>规格</th>
              <th>单价</th>
              <th>数量</th>
              <th>金额</th>
              <th>优惠券说明</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td><%= @order_item.spu_name %></td>
              <td><%= @order_item.option_value_presentation %></td>
              <td><%= @order_item.fee %></td>
              <td><%= @order_item.quantity %></td>
              <td><%= @order_item.fee * @order_item.quantity %></td>
              <td><%=  %></td>
            </tr>
          </tbody>
        </table>
        <div class="line"></div>
        <h5>售后处理</h5>
        <div class="row">
          <div class="col-md-12">
            <div class="form-group">
              <div class="form-label">审核</div>
              <div class="custom-controls-stacked">
                <label class="custom-control custom-radio custom-control-inline">
                  <%= f.radio_button :state, "agree", { class: "custom-control-input" } %>
                  <span class="custom-control-label">同意</span>
                </label>
                <label class="custom-control custom-radio custom-control-inline">
                  <%= f.radio_button :state, "disagree", { class: "custom-control-input" } %>
                  <span class="custom-control-label">不同意</span>
                </label>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="card-footer text-right">
        <button type="submit" class="btn btn-primary">保 存</button>
      </div>
    </div>
  </div>
<% end %>